package com.ftg.learn.framework.mybatis.javabase;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 接口
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/9/5 下午2:22
 */
public interface StudentMapper {
    @Select("select * from j2305.student")
    List<Map<String,Object>> show();

    /**
     * 学生添加操作
     * @param stu_name  姓名
     * @param stu_sex   性别
     * @return
     */
    @Insert("insert into student(stu_name,stu_sex) values(#{stu_name},#{stu_sex})")
    int saveStudent(@Param("stu_name") String stu_name,@Param("stu_sex") String stu_sex);

}
